package com.zbl.zblproject.core.utils;

import com.zbl.zblproject.core.entity.Result;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/9
 * Result是用来对http进行返回的实体类
 */
public final class ResultUtil {

    public static Result success(String msg){
        return success(msg, null);
    }

    public static Result success(String msg, Object data){
        return result(200, msg, data);
    }

    public static Result error(String msg){
        return error(msg, null);
    }

    public static Result error(String msg, Object data){
        return result(500, msg, data);
    }

    public static Result result(int code, String msg, Object data){
        return new Result(code, msg, data);
    }


}
